extends Node

var client=StreamPeerTCP.new()
signal receive(data)

func start():
	client.connect_to_host('localhost',3000)
	if client.is_connected_to_host():
		var thread=Thread.new()
		thread.start(self,"check")

func check():
	while(true):
		var rev_num = client.get_available_bytes()
		if rev_num > 0:
			var s = client.get_utf8_string(rev_num)
			var data=parse_json(s)
			emit_signal("receive",data)
	pass



